package com.junzhiit.nengji.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum BankType {
	
	BOC(0,"中国银行"),
	CCB(1,"建设银行"),
	ABC(2,"农业银行"),
	ICBC(3,"工商银行"),
	BC(4,"交通银行"),
	PSBC(5,"邮储银行"),
	CNCB(6,"中信银行"),
	CEB(7,"光大银行"),
	HB(8,"华夏银行"),
	CGB(9,"广发银行"),
	PAB(10,"平安银行"),
	CMBC(11,"招商银行"),
	SPDB(12,"浦发银行"),
	CIB(13,"兴业银行"),
	CMSB(14,"民生银行"),
	EB(15,"恒丰银行"),
	CZB(16,"浙商银行"),
	CBHB(17,"渤海银行"),
	ZRCB(18,"农商银行");
	
	private Integer value;
	private String text;

	private BankType(Integer value,String text) {
		this.value = value;
		this.text = text;
	}

	public Integer toIntValue() {
		return this.value;
	}
	
	public String toStringText() {
		return this.text;
	}

	public static BankType toStatus(Integer value) {
		if (BOC.value == value) {
			return BOC;
		} else if (CCB.value == value) {
			return CCB;
		} else if (ABC.value == value) {
			return ABC;
		} else if (ICBC.value == value) {
			return ICBC;
		} else if (BC.value == value) {
			return BC;
		} else if (PSBC.value == value) {
			return PSBC;
		} else if (CNCB.value == value) {
			return CNCB;
		} else if (CEB.value == value) {
			return CEB;
		} else if (HB.value == value) {
			return HB;
		} else if (CGB.value == value) {
			return CGB;
		} else if (PAB.value == value) {
			return PAB;
		} else if (CMBC.value == value) {
			return CMBC;
		} else if (SPDB.value == value) {
			return SPDB;
		} else if (CIB.value == value) {
			return CIB;
		} else if (CMSB.value == value) {
			return CMSB;
		} else if (EB.value == value) {
			return EB;
		} else if (CZB.value == value) {
			return CZB;
		} else if (CBHB.value == value) {
			return CBHB;
		} else if (ZRCB.value == value) {
			return ZRCB;
		}else {
			throw new InvalidArgumentException("Unknown BankType[" + value + "].");
		}
	}
}
